package com.tang.functions;

import com.tang.bean.WaterSensor;
import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.api.common.functions.ReduceFunction;

/**
 * MapFuntion实现类实现类
 *
 * @author tang
 * @since 2023/6/7 22:07
 */
public class WaterSensorMapFunction implements MapFunction<String, WaterSensor> {
    
    @Override
    public WaterSensor map(String value) throws Exception {
        String[] data = value.split(",");
        return new WaterSensor(data[0], Long.valueOf(data[1]), Integer.valueOf(data[2]));
    }
    
}
